<script type="text/javascript">
    $(document).ready(function()
    {
        $("select, input").uniform();
    });
</script>
<?php
    function __autoload($class_name)
	{
		include_once('../classes/'.strtolower($class_name).'.php');
	}
    
    if(isset($_POST['MaLoaiSanPham']))
        $MaLoaiSanPham = $_POST['MaLoaiSanPham'];
    else
        $MaLoaiSanPham = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap1']))
        $MaLoaiSanPhamCap1 = $_POST['MaLoaiSanPhamCap1'];
    else
        $MaLoaiSanPhamCap1 = 0;
        
    if(isset($_POST['MaLoaiSanPhamCap3']))
        $MaLoaiSanPhamCap3 = $_POST['MaLoaiSanPhamCap3'];
    else
        $MaLoaiSanPhamCap3 = 0;
        
    $MaLoaiSanPhamCap2 = 0;
    
    $loaisanphamc2 = new loaisanphamc2bs();
    $ret_loaisanphamc2 = $loaisanphamc2->getList();
    
    $loaisanphamc2->MaLoaiSanPham = $MaLoaiSanPham;
    $loaisanphamc2->MaLoaiSanPhamCap1 = $MaLoaiSanPhamCap1;
    $loaisanphamc2->MaLoaiSanPhamCap3 = $MaLoaiSanPhamCap3;
    
    $ret_loaisanphamc2_id = $loaisanphamc2->getIds();
    $MaLoaiSanPhamCap2 = $ret_loaisanphamc2_id[0]['MaLoaiSanPhamCap2'];
    
	echo '<select name="MaLoaiSanPhamCap2" id="MaLoaiSanPhamCap2" onchange="onchangeStyleProductSec();">';
	for($i = 0; $i < ($ret_loaisanphamc2 != false ? count($ret_loaisanphamc2) : 0); $i++)
	{
        $selected = '';
        if($ret_loaisanphamc2[$i]['MaLoaiSanPhamCap2'] == $MaLoaiSanPhamCap2)
            $selected = "selected = selected";
		echo "<option {$selected} value=\"{$ret_loaisanphamc2[$i]['MaLoaiSanPhamCap2']}\">{$ret_loaisanphamc2[$i]['TenLoaiSanPhamCap2']}</option>";
	}
    echo '</select>';
?>